/*
 *   AS IS License
 * ==Naive Coders==
 */
package org.naive.metawatch.converter.cap;

import java.text.ParseException;
import org.naive.metawatch.converter.parser.cap.CapParseContext;
import org.naive.metawatch.converter.parser.cap.CapParseable;

/**
 *
 * @author gbu.000
 */
public class CapTypeDescriptor extends CapParseable {

    public byte type[];

    public CapTypeDescriptor() {
    }

    @Override
    public void parse(CapParseContext px) throws ParseException {
        int nibble_count = px.readByte() & 0xFF;
        type = new byte[(nibble_count + 1) / 2];
        for (int i = 0; i < type.length; i++) {
            type[i] = px.readByte();
        }
    }
}
